<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Guest_m extends FOX_Model
{

	function __construct ()
	{
		parent::__construct();
	}
	
	public function get_guest_by_machine_key($machine_key){
        $this->db->select('*');
        $query = $this->db->where('machine_key',$machine_key)->get('guests');
        return $query->row_array();
    }

    public function add_guest($data){

        $this->db->insert('guests',$data);
        return ($this->db->affected_rows() > 0) ? TRUE : FALSE;
    }
	
	public function update_guest($machine_key,$data){

        $this->db->where('machine_key',$machine_key);
        $this->db->update('guests', $data);
        return ($this->db->affected_rows() > 0) ? TRUE : FALSE;
    }
	
}
